import api from "./api_base";

// 上传GPU图片
export const uploadImg = (formData: FormData, type: string) => {
  return api.post(`/upload/${type}`, formData);
};

//获取配置
export const getConfig = (data: any) => {
  return api({
    url: "/commit/config",
    method: "get",
    params: {
      userId: data.userId || "",
      id: data.id || "",
    },
  });
};

//获取评论
export const getComment = (data: any) => {
  return api({
    url: "/commit/get",
    method: "get",
    params: data,
  });
};

//获取用户数量
export const getUserCount = () => {
  return api({
    url: "/user/count",
    method: "get",
  });
};

//上传视频
export const uploadVideo = (formData: FormData) => {
  return api.post("/video/upload", formData, {
    timeout: 60000, // 设置超时时间为60秒，单位为毫秒
  });
};

//获取视频
export const getVideo = (id?: string) => {
  return api({
    url: "/video/list",
    method: "get",
    params: {
      id,
    },
  });
};

//上传日志
export const uploadLog = (data: any) => {
  return api({
    url: "/commit/log",
    method: "post",
    data,
  });
};
